<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>API Test</title>
<link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css">

<script type="text/javascript">
var RESULT_OK = 1;
var RESULT_FAIL_STATUSCODE = 2; //failed due to non-200 status code returned from server
var RESULT_FAIL_MISMATCH = 3;
//ipPort = '10.58.88.212:8080';
//ipPort = '10.58.89.85:8080/APITest2/server';
ipPort = '10.59.48.70:9999/AT/server';
//ipPort = 'localhost:8080/AT/server';
overallSteps = 0;
overallSubcases = 0;
</script>
<script type="text/javascript" src="extjs/ext-all-debug.js"></script>
<script type="text/javascript" src="js/case/CaseReader.js"></script>
<script type="text/javascript" src="js/case/CaseDetailModel.js"></script>
<script type="text/javascript" src="js/case/ServerModel.js"></script>
<script type="text/javascript" src="js/case/CaseResult.js"></script>
<script type="text/javascript" src="js/case/ServerServer.js"></script>
<script type="text/javascript" src="js/case/ServerProfile.js"></script>
<script type="text/javascript" src="js/case/Server.js"></script>
<script type="text/javascript" src="js/case/CaseList.js"></script>
<script type="text/javascript" src="js/case/CaseStep2.js"></script>
<script type="text/javascript" src="js/case/SubCase.js"></script>
<script type="text/javascript" src="js/case/CaseDetail.js"></script>
<script type="text/javascript" src="js/case/report.js"></script>
<script type="text/javascript" src="js/case/StatusScreen.js"></script>


<script type="text/javascript">
Ext.Loader.setConfig({enabled: true});
Ext.Loader.setPath('Ext.ux', './js/ux/');
Ext.require('Ext.ux.TabCloseMenu');
var caseList, caseDetail, statusScreen, reportWin;
//ipPort = '10.58.89.85:8080';

function init(){
	 
	//ipPort = '10.58.89.85:8080';
	caseList = Ext.create('case.list');
	statusScreen = Ext.create('status.screen');
	caseDetail = Ext.create('case.detail');
	caseDetail.load(111);
	reportWin = null;
	var row = Ext.create(Ext.Panel,{
		id: 0,
		
		layout: {
                		type: 'hbox',
                		pack: 'start'
                	},
        items: [{
        	xtype: 'displayfield',
        	value: 'Subcase',
        	flex: 8
        },{
        	xtype: 'displayfield',
        	value: 'Status',
        	flex: 5
        }]
	});
	var statpan = me_status.getComponent('statusPanel');
	statpan.add(row);
}

Ext.onReady(function() {
    Ext.Ajax.timeout = 900000; //900s
    var cw;
    init();
    
    Ext.create('Ext.Viewport', {
        layout: {
            type: 'border',
            padding: 5
        },
        //defaults: {
        //    split: true
        //},
        items:[{
        	region: 'center',
        	layout: {
        		type: 'border',
        		padding: 5
        	},
        	defaults: {
        		split: true
        	},
//       	dockedItems: [{
//	        	xtype: 'toolbar',
//            	dock: 'top',
//            	items: [{
//					xtype: 'combobox',
//					store: profileStore,
//					emptyText: 'Select Profile',
//			        displayField: 'name',
//			        valueField: 'id'						
//				}]
//        	}],
        	items: [{
				xtype: 'container',
				layout: 'border',
				region: 'west',
				split: true,
				width: '60%',
				// collapsible: true,
				items: [{
	                region: 'center',
                	layout: 'anchor',
					title: 'Case List',
                	items: [caseList]
            	},{
	                region: 'south',
					height: '40%',
					padding: '5 0 0 0',
					title: 'Status Screen',
                	layout: 'anchor',	
					items: [statusScreen]
				}]
        	}, caseDetail]
        }]
    	});
    /*
    var formPanel = Ext.getCmp("step0");
    formPanel.el.mask('Please Wait', 'x-mask-loading');
    formPanel.getForm().load({
    	url:'caseLoad.txt',
    	success: function() {
			formPanel.el.unmask();
		}
    });
    */
});

Ext.define('serverModel', {
	extend: 'Ext.data.Model',
	fields: ['name'],
	proxy: {
		type: 'rest',
		url: 'http://' + ipPort + '/bpcmetadata',
		reader: {
			type: 'json',
			root: 'servers'
		}
//		writer: {
//			type: 'json'
//		}
	}
});

</script>

</head>
<body>
</body>
</html>